import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:largefriends/res/lf_double_ext.dart';
import 'package:largefriends/service/lf_auth_service.dart';
import 'package:largefriends/widgets/custom_cache_image.dart';

import '../../../entity/entities/chat_new_message_entity.dart';

class LfMessagePremiumWink extends StatelessWidget {
  final ChatNewMessageEntity data;

  const LfMessagePremiumWink({super.key, required this.data});

  @override
  Widget build(BuildContext context) {
    LfAuthService authService = Get.find();
    var isSender =
        data.sender?.profile?.userId == authService.currentAccount!.userId;
    Widget image = CustomCacheImage(
      imageUrl: data.xInfo?.url,
      width: 100.r,
      height: 100.r,
    );
    if (isSender) {
      return Row(
        mainAxisAlignment: MainAxisAlignment.end,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [Flexible(child: image), 10.w.sbw],
      );
    } else {
      return Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [10.w.sbw, Flexible(child: image), 10.w.sbw],
      );
    }
  }
}
